//自定义图片放大
;(function($){  
	$.fn.debigger=function(params){
		var tobigger = params.multiple;
		var tobiggerimgs = $(this);
		tobiggerimgs.mouseover(function(e){
			var thisimg = $(this);
			var left = thisimg.offset().left;
			var top = thisimg.offset().top;
			var width = thisimg.width();
			var height = thisimg.height();
			var tlcenter = left + width/2;
			var tleft = tlcenter-(tobigger*width/2);
			var ttcenter = top + height/2;
			var ttop = ttcenter-(tobigger*height/2);
			thisimg.css("opacity",0);
			var tindex = tobiggerimgs.index(this);
			var thisimgclasses = thisimg.attr("class");
			var appendimg = $("<img class='tobiggerimgsx"+tindex+" "+thisimgclasses+"' src='"+$(this).attr("src")+"' style='z-index:10;position:absolute;left:"+left+"px;top:"+top+"px;width:"+width+"px;height:"+height+"px;'/>");
			$("body").append(appendimg);
			$(".tobiggerimgsx"+tindex).animate({left:tleft+'px',top:ttop+'px',width:width*tobigger+'px',height:height*tobigger+'px'},'fast');
			$(".tobiggerimgsx"+tindex).mouseleave(function(e){
				$(".tobiggerimgsx"+tindex).animate({left:left+'px',top:top+'px',width:width+'px',height:height+'px'},'fast',function(){
					$(this).remove();
					thisimg.css("opacity",1);
				});
			});
		});
	}
})(jQuery); 